var t = require;
var e = module;
var o = exports;
var n =
    (this && this.__extends) ||
    (function () {
        var t = function (e, o) {
            return (t =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                })(e, o);
        };
        return function (e, o) {
            function n() {
                this.constructor = e;
            }
            t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
        };
    })();
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("fsm"),
    a = t("Util"),
    i = t("fightManager"),
    s = t("AIIdle"),
    c = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (e.time = 0.5), e;
        }
        return (
            n(e, t),
            (e.prototype.onEnter = function () {
                var t = this.context.infodata.SearchRanger[0],
                    e = this.context.infodata.SearchRanger[0],
                    o = a.RandomInt(-t, t),
                    n = a.RandomInt(-e, e),
                    r = Math.atan2(n, o);
                (this.x = Math.cos(r)),
                    (this.y = Math.sin(r)),
                    "Run" != this.context.sk.getCur() && this.context.sk.play("Run", !0);
            }),
            (e.prototype.onUpdate = function (t) {
                this.context.moveTo(this.x, this.y),
                    (this.time -= i.default.gamedt(t)),
                    this.time <= 0 && r.changeState(this.context, s.default);
            }),
            (e.prototype.onExit = function () {
                this.context.stop();
            }),
            e
        );
    })(t("bodyAI").default);
o.default = c;
